package com.xiaoaoc.SmartToilet.service;

import com.xiaoaoc.SmartToilet.model.Toilet;
import com.xiaoaoc.SmartToilet.repository.ToiletRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.List;
import java.util.Optional;

@Service
public class ToiletService {

    @Autowired
    private ToiletRepository toiletRepository;

    public List<Toilet> getAllToilets() {
        return toiletRepository.findAll();
    }

    public Toilet createToilet(Toilet toilet){
       return toiletRepository.save(toilet);
    }


}
